<?php
namespace App\Admin\Models;
use Common\BaseModel;
class ViewHomeAdCofig extends BaseModel
{
    public function initialize()
    {
        parent::initialize();
        $this->setSource('view_home_ad_cofig');
    }
    public function get_list($params){
        $where = '';
        if(isset($params['name']) && !empty($params['name'])){
            $where = "name like '%{$params['name']}%'";
        }
        return $this->find(array(
                $where,
                'order' => 'id desc'
            )
        );
    }

    public function find_by_id_obj($id){
        return $this->findFirstById($id);
    }

}
